Skip to content

Fix GitLab historical tag pipeline normalization - #5203

Merged
arturcic merged 3 commits into
GitTools:mainfrom
arturcic:codex/fix-4825-gitlab-tag-normalization
Sep 11, 2026
Merged

arturcic merged 3 commits into
GitTools:mainfrom
arturcic:codex/fix-4825-gitlab-tag-normalization

Conversation

@arturcic

@arturcic arturcic commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Description

Provide the canonical CI_COMMIT_TAG reference through GitLabCi.GetCurrentTag(), using a new ReferenceName.FromTagName() factory to centralize construction from literal tag names. This lets the existing normalization path preserve detached HEAD when the explicitly selected local tag resolves to the checked-out commit, while retaining branch and merge-request selection and fallback discovery. Document GitLab tag identification, historical tag reruns, and the local-tag/HEAD requirements.

Related Issue

Resolves #4825

Motivation and Context

Rerunning a historical GitLab tag pipeline after main advances can fail because GitLab advertises pipeline and deployment refs at the same commit as the tag. Supplying the selected tag avoids the ambiguous remote-tip lookup. Tag names, including names containing slashes or a literal refs/tags/ prefix, are preserved when constructing the canonical reference.

How Has This Been Tested?

Validated locally on macOS arm64 with .NET SDK 10.0.401 and both managed and libgit2 backends:

  • Before the fix, all four historical-tag regression cases failed: lightweight/annotated tags with ambiguous pipeline/deployment refs, and both tag types with an unavailable remote. All four pass afterward, preserving SHA, detached HEAD, and version 1.2.3.
  • All 58 reference-name and remote-repository tests and 103 build-agent tests pass on each backend. Tests cover literal tag-name construction (including ref-like names), null/empty factory inputs, missing/empty/nonexistent/mismatched selected tags, and unchanged branch/MR behavior.
  • Main solution build passes with zero warnings and errors; formatting verification for changed files and git diff --check pass.

The full solution test suite and a live GitLab pipeline were not run.

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed. (All new tests and the relevant existing suites passed; the full suite was not run.)

Copilot AI lite review requested due to automatic review settings September 11, 2026 13:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 11, 2026 13:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 11, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified, and the changes include targeted tests and documentation.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@arturcic
arturcic merged commit fb3310b into GitTools:main Sep 11, 2026
39 checks passed
@arturcic
arturcic deleted the codex/fix-4825-gitlab-tag-normalization branch September 11, 2026 13:56
@mergify

mergify Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Thank you @arturcic for your contribution!

This was referenced Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ISSUE]: Gitlab CI remote ref detection for tags failing

2 participants